//
//  LikeAndReplyButton.m
//  MiaoTu
//
//  Created by dllo on 16/9/28.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LikeAndReplyButton.h"
#import "UIView+Frame.h"

@implementation LikeAndReplyButton

- (void)setImage:(UIImage *)image forState:(UIControlState)state {
    [super setImage:image forState:state];
    [self layoutIfNeeded];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    CGFloat height = self.titleLabel.dk_height;
    CGFloat topEdge = (self.dk_height - height) / 2;
    CGFloat bottomEdge = topEdge;
    CGFloat leftEdge = (self.dk_width - height - self.titleLabel.dk_width) / 2;
    CGFloat rightEdge = leftEdge + self.titleLabel.dk_width;
    self.imageEdgeInsets = UIEdgeInsetsMake(topEdge, leftEdge, bottomEdge, rightEdge);
    
}

@end
